package editorview.views;

import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.IWorkbenchPage;

public class EditorsViewTreeContentProvider implements ITreeContentProvider {

  private TreeViewer viewer;

  public EditorsViewTreeContentProvider(TreeViewer viewer) {
    this.viewer = viewer;
  }

  @Override
  public void dispose() {
  }

  @Override
  public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
  }

  @Override
  public Object[] getElements(Object inputElement) {
    if (inputElement instanceof IWorkbenchPage) {
      return ((IWorkbenchPage) inputElement).getEditorReferences();
    }
    return null;
  }

  @Override
  public Object[] getChildren(Object parentElement) {
    return null;
  }

  @Override
  public Object getParent(Object element) {
    return null;
  }

  @Override
  public boolean hasChildren(Object element) {
    return false;
  }

}
